#include "glare.core.StringConverter.h"

namespace Glare {

	Glare::string StringConverter::ToString(const int& i)
	{
		std::stringstream sstr;
		sstr << i;
		return sstr.str();
	}

	Glare::string StringConverter::ToString(const uint& ui)
	{
		std::stringstream sstr;
		sstr << ui;
		return sstr.str();
	}

	Glare::string StringConverter::ToString(const float& f)
	{
		std::stringstream sstr;
		sstr << f;
		return sstr.str();
	}

	uint StringConverter::ParseUint(const string& str)
	{
		uint result;
		std::stringstream sstr(str);
		sstr >> result;

		if (sstr.fail())
			throw Exception("unable to parse uint");

		return result;
	}

}